package com.twt.controller;

import com.twt.entity.Result;
import com.twt.service.PickLakeService;
import com.twt.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/PickLake")
public class PickLakeController {

    @Autowired
    private PickLakeService pickLakeService;

    /**
     * 捞湖仅查看
     *
     * @param username 参数封装
     * @return Result
     */
    //http://localhost:8080/PickLake/view?username=3020244106
    @GetMapping("/view")
    public Result pickLakeView(@RequestParam("username") String username) {
        return pickLakeService.pickLakeView(username);
    }

    /**
     * 捞湖
     *
     * @param username,bottleId 参数封装
     * @return Result
     */
    //http://localhost:8080/PickLake/pick?username=3020244106&bottleId=1&context=shit
    @PostMapping("/pick")
    public Result pickLake(@RequestParam("username") String username, @RequestParam("bottleId") int bottleId,@RequestParam("context")String context) {
        return pickLakeService.pickLake(username, bottleId,context);
    }
}
